home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / utils / bibextract / Makefile < prev    next >
Makefile  |  1992-11-01  |  5KB  |  217 lines

  1. #=======================================================================
  2. # Makefile for files in ~beebe/tex/bibextract.
  3. #
  4. # Current target list:
  5. #    all            make txt and spell targets
  6. #    bibextract.tar        tar archive file for ftp distribution
  7. #    bibextract.zip        Info-zip archive file for ftp distribution
  8. #    bibextract.zoo        zoo archive file for ftp distribution
  9. #    clean            clean up temporary files
  10. #    clobber            remove all files that can be remade by make
  11. #    install            install programs in system directories
  12. #    install.time        internal target
  13. #    install-ftp        install programs in anonymous ftp directories
  14. #    install-ftp.time    internal target
  15. #    spell            make *.spl files from *.man files
  16. #    test-version
  17. #    txt            make *.txt files from *.man files
  18. #    uninstall        remove programs from system directories
  19. #    uninstall-ftp        remove programs from anonymous ftp directories
  20. #    verify-checksums    verify checksums in all files that have them
  21. #
  22. # [02-Nov-1992]
  23. #=======================================================================
  24.  
  25. # Change these to match local conventions:
  26.  
  27. BINDIR        = /usr/local/bin
  28. FTPDIR        = /usr/spool/ftp/pub/tex/bib
  29. LIBDIR        = /usr/local/lib/bibextract
  30. MANDIR        = /usr/local/man/man1
  31. MANEXT        = 1
  32.  
  33. #=======================================================================
  34.  
  35. AWK        = nawk
  36.  
  37. AWKFILES    = bibextract.awk citefind.awk citetags.awk
  38.  
  39. BASENAMES    = $(AWKFILES:.awk=)
  40.  
  41. BINFILES    = $(AWKFILES:.awk=.sh)
  42.  
  43. # If you don't have checksum installed, use cat instead.
  44. CHECKSUM    = checksum
  45.  
  46. CHMOD        = chmod
  47.  
  48. COMPRESS    = compress
  49.  
  50. CP        = /bin/cp
  51.  
  52. DEROFF        = deroff
  53.  
  54. DIST-FILES    = README Makefile $(BINFILES) $(AWKFILES) \
  55.           $(MANFILES) $(PSFILES) $(TXTFILES) $(AWKFILES:.awk=.sok)
  56.  
  57. DITROFF        = ditroff    ## AT&T
  58. DITROFF        = groff        ## GNU
  59.  
  60. HDRFILES    = $(BINFILES) $(AWKFILES) $(MANFILES)
  61.  
  62. LN        = /bin/ln
  63.  
  64. MANFILES    = $(AWKFILES:.awk=.man)
  65.  
  66. NROFF        = nroff
  67.  
  68. PSFILES        = $(MANFILES:.man=.ps)
  69.  
  70. RM        = /bin/rm -f
  71.  
  72. SED        = /bin/sed
  73.  
  74. SEDCMD        = $(SED) -e 's=@LIBDIR@=$(LIBDIR)=g' \
  75.              -e 's=@BINDIR@=$(BINDIR)=g'
  76.  
  77. SHELL        = /bin/sh
  78.  
  79. SPLFILES    = $(AWKFILES:.awk=.spl)
  80.  
  81. TAR        = tar
  82.  
  83. TXTFILES    = $(AWKFILES:.awk=.txt)
  84.  
  85. UNZIP        = unzip
  86.  
  87. VERSION        = `$(AWK) '/^\#\#\#[ \t]*version *= *"[0-9.]+", *$$/ \
  88.         { gsub(/[^0-9.]/,"",$$4); print $$4 }' citefind.sh`
  89.  
  90. ZIP        = zip
  91.  
  92. ZOO        = zoo
  93.  
  94. #=======================================================================
  95.  
  96. .SUFFIXES:    .txt .spl .ps .man
  97.  
  98. .man.ps:
  99.     $(SEDCMD) $< | $(DITROFF) -Tps -man - >$@
  100.  
  101. .man.spl:
  102.     $(DEROFF) $< | spell +$*.sok >$*.spl
  103.     @if [ -s $*.spl ] ; \
  104.     then \
  105.         echo "Spelling exceptions in $*.spl" ; \
  106.         cat $*.spl ; \
  107.     fi
  108.  
  109. .man.txt:
  110.     $(SEDCMD) $< | $(NROFF) -man - | col -b | expand >$@
  111.  
  112. #=======================================================================
  113.  
  114. all:    spell txt ps
  115.  
  116. bibextract.tar:    $(DIST-FILES)
  117.     -$(RM) bibextract.tar bibextract.tar-lst
  118.     $(TAR) chf bibextract.tar $(DIST-FILES)
  119.     -mkdir bibextract-$(VERSION)
  120.     cd bibextract-$(VERSION); tar xf ../bibextract.tar
  121.     $(TAR) cf bibextract-$(VERSION).tar bibextract-$(VERSION)
  122.     -$(RM) -r bibextract-$(VERSION)
  123.     -$(RM) bibextract.tar
  124.     $(LN) bibextract-$(VERSION).tar bibextract.tar
  125.  
  126. bibextract.zip:    $(DIST-FILES)
  127.     -$(RM) bibextract*.zip
  128.     -$(RM) bibextract*.zip-lst
  129.     $(ZIP) bibextract-$(VERSION).zip $(DIST-FILES)
  130.     $(UNZIP) -v bibextract-$(VERSION).zip >bibextract-$(VERSION).zip-lst
  131.     $(LN) bibextract-$(VERSION).zip bibextract.zip
  132.  
  133. bibextract.zoo:    $(DIST-FILES)
  134.     -$(RM) bibextract*.zoo
  135.     -$(RM) bibextract*.zoo-lst
  136.     $(ZOO) a bibextract-$(VERSION).zoo $(DIST-FILES)
  137.     $(ZOO) v bibextract-$(VERSION).zoo >bibextract-$(VERSION).zoo-lst
  138.     $(LN) bibextract-$(VERSION).zoo bibextract.zoo
  139. clean:
  140.     -$(RM) *.ps
  141.     -$(RM) *.spl
  142.     -$(RM) *.tar
  143.     -$(RM) *.tar-lst
  144.     -$(RM) *.txt
  145.     -$(RM) *.zip
  146.     -$(RM) *.zip-lst
  147.     -$(RM) *.zoo
  148.     -$(RM) *.zoo-lst
  149.     -$(RM) *~
  150.     -$(RM) \#*
  151.     -$(RM) a.out core
  152.  
  153. clobber:    clean
  154.     -$(RM) install.time install-ftp.time
  155.  
  156. install:    install.time
  157.  
  158. install.time:    $(AWKFILES) $(BINFILES) $(MANFILES)
  159.     -if [ ! -d $(LIBDIR) ] ; then mkdir $(LIBDIR) ; fi
  160.     for f in $(BASENAMES) ; \
  161.     do \
  162.         $(SEDCMD) $$f.sh | $(CHECKSUM) > $(BINDIR)/$$f ; \
  163.         $(SEDCMD) $$f.awk | $(CHECKSUM) > $(LIBDIR)/$$f.awk ; \
  164.         $(SEDCMD) $$f.man | $(CHECKSUM) > $(MANDIR)/$$f.$(MANEXT) ; \
  165.         $(CHMOD) 775 $(BINDIR)/$$f ; \
  166.         $(CHMOD) 664 $(LIBDIR)/$$f.awk ; \
  167.         $(CHMOD) 664 $(MANDIR)/$$f.$(MANEXT) ; \
  168.     done
  169.     date >install.time
  170.  
  171. install-ftp:    install-ftp.time
  172.  
  173. install-ftp.time:    bibextract.tar bibextract.zip bibextract.zoo
  174.     $(TAR) tvf bibextract-$(VERSION).tar >$(FTPDIR)/bibextract-$(VERSION).tar-lst
  175.     $(COMPRESS) <bibextract-$(VERSION).tar \
  176.         >$(FTPDIR)/bibextract-$(VERSION).tar.z
  177.     $(CP) bibextract-$(VERSION).zip $(FTPDIR)
  178.     $(CP) bibextract-$(VERSION).zip-lst $(FTPDIR)
  179.     $(CP) bibextract-$(VERSION).zoo $(FTPDIR)
  180.     $(CP) bibextract-$(VERSION).zoo-lst $(FTPDIR)
  181.     ls -l $(FTPDIR)/bibextract*
  182.     date >install-ftp.time
  183.  
  184. ps:    $(PSFILES)
  185.  
  186. spell:    $(SPLFILES)
  187.  
  188. test-version:
  189.     @echo "Version number is ""'"$(VERSION)"'"
  190.  
  191. txt:    $(TXTFILES)
  192.  
  193. uninstall:
  194.     -for f in $(BINFILES) ; \
  195.     do \
  196.         $(RM) $(BINDIR)/$$f $(LIBDIR)/$$f $(MANDIR)/$$f.$(MANEXT) ; \
  197.     done
  198.     -$(RM) install.time
  199.  
  200. uninstall-ftp:
  201.     -$(RM) $(FTPDIR)/bibextract-$(VERSION).tar.z
  202.     -$(RM) $(FTPDIR)/bibextract-$(VERSION).tar-lst
  203.     -$(RM) $(FTPDIR)/bibextract-$(VERSION).zip
  204.     -$(RM) $(FTPDIR)/bibextract-$(VERSION).zip-lst
  205.     -$(RM) $(FTPDIR)/bibextract-$(VERSION).zoo
  206.     -$(RM) $(FTPDIR)/bibextract-$(VERSION).zoo-lst
  207.     -$(RM) install-ftp.time
  208.  
  209. verify-checksums:
  210.     for f in $(HDRFILES) ; \
  211.     do \
  212.         echo $$f ; \
  213.         $(CHECKSUM) -v $$f ; \
  214.     done
  215.  
  216. #=======================================================================
  217.